
<form id="form_edit">
<input type="hidden" name="rate" id="rate" value="{[$result.rate]}" size="12">
<input type="hidden" name="rmb" id="rmb" value="{[$result.rmb]}" size="12">
<table>
	<tr>
		<td width="20%" align="right">负责人：</td>
		<td width="30%"><input type="text" name="emp" id="emp" value="{[$result.emp]}:{[$result.emp_t]}" size="12" title="{[$t.emp_|emp:'负责人']}"> <input
			type="checkbox" name="t_emp" id="t_emp" value="{[$smarty.session.id]}:{[$smarty.session.name]}"> 自己</td>
		<td width="20%" align="right">填单日期：</td>
		<td width="30%"><input type="text" name="date" id="date" value="{[$smarty.now|date_format:'%Y-%m-%d']}" size="12"></td>
	</tr>
	<tr>
		<td align="right">供应商：</td>
		<td><input type="text" name="supplier" id="supplier"
			value="{[$result.supplier]}:{[$result.supplier_t]}" size="16" title="{[$t.supplier]}"> <a href="javascript:void(0)" id="supplier_x"
			onclick="Common.toggle(this, '#label_linkman')" class="ui-icon ui-icon-circle-triangle-w" style="display: inline-table"></a></td>
		<td align="right">是否客户：</td>
		<td><select name='iscustomer' id='iscustomer'>
			{[html_options options=$iscustomer_option selected=$result.iscustomer]}
		</select></td>
	</tr>
	<tr id="label_linkman">
		<td></td>
		<td colspan="3">{[include file="_linkman.tpl"]}</td>
	</tr>
	<tr>
		<td align="right">事由：</td>
		<td colspan="3"><textarea rows="2" name="name" cols="55">{[$result.name]}</textarea></td>
	</tr>
	<tr>
		<td align="right">金额：</td>
		<td colspan="3"><input type="text" name="amount" id="amount" value="{[$result.amount]}" size="12"> <select
			name='currency' id='currency'>
			{[html_options options=$currency_option selected=$result.currency]}
		</select> <label id="label_amount"></label></td>
	</tr>
	<tr>
		<td align="right">凭证：</td>
		<td><select name='invoice' id='invoice'>
			{[html_options options=$invoice_option selected=$result.invoice]}
		</select></td>
		<td align="right">分类：</td>
		<td><select name='type'>
			{[html_options options=$type_option selected=$result.type]}
		</select></td>		
	</tr>
	<tr>
		<td align="right">支付：</td>
		<td><select name='payment' id='payment'>
			{[html_options options=$payment_option selected=$result.payment]}
		</select> <a href="javascript:void(0)" id="payment_x" onclick="Pay.collapse(this)"
			class="ui-icon ui-icon-circle-triangle-s" style="display: inline-table"></a></td>
		<td align="right">紧急程度：</td>
		<td><select name='urgent'>
			{[html_options options=$urgent_option selected=$result.urgent]}
		</select></td>
	</tr>
	<tr id="label_payment_bank">
		<td></td>
		<td colspan="3">{[include file="finance/payment/_bank.tpl"]}</td>
	</tr>
	<tr id="label_payment_linkman">
		<td></td>
		<td colspan="3">{[include file="finance/payment/_linkman.tpl"]}</td>
	</tr>
	<tr>
		<td align="right">水单：</td>
		<td colspan="3"><select name='voucher' id='voucher'>
			{[html_options options=$voucher_option selected=$result.voucher]}
		</select> <label id="label_voucher"> <input type="text" name="voucher_x" id="voucher_x" value="{[$result.voucher_x]}"
			size="32"> <select name='voucher_t' id='voucher_t'>
		</select></label></td>
	</tr>	
	<tr>
		<td align="right">备注：</td>
		<td colspan="3"><textarea rows="3" name="content" id="content" cols="55">{[$result.content]}</textarea></td>
	</tr>	
</table>
</form>

<script type="text/javascript" src="js/finance/payment/add.js?r={[$smarty.now]}"></script>

<script type='text/javascript'>
Pay._supplier($('#supplier').val());
Pay._voucher($('#voucher').val());

var a = $("#amount").val();
var b = $("#currency").find("option:selected").text();

Currency.upper(a, b, "#label_amount");
</script>

